/*
 * Copyright (c) 2015, CETIC.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the Institute nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

/**
 * \file
 *         6LBR-Demo Project Configuration
 * \author
 *         6LBR Team <6lbr@cetic.be>
 */

#ifndef CONTIKI_RESOURCES_H
#define CONTIKI_RESOURCES_H

#if PLATFORM_HAS_SHT11 || PLATFORM_HAS_SHT21

#define REST_CONF_PLATFORM_HAS_SHT_TEMP 1

#define REST_CONF_RES_SHT_TEMP_IF IF_SENSOR
#define REST_CONF_RES_SHT_TEMP_TYPE TEMPERATURE_SENSOR_RT
#define REST_CONF_RES_SHT_TEMP_ID TEMPERATURE_SENSOR_RES_ID
#define REST_CONF_RES_SHT_TEMP_FORMAT COAP_RESOURCE_TYPE_DECIMAL_TWO
#define REST_CONF_RES_SHT_TEMP_SO_TYPE TEMPERATURE_SENSOR
#define REST_CONF_RES_SHT_TEMP_SO_INSTANCE_ID "0"
#define REST_CONF_RES_SHT_TEMP_IPSO_APP_FW_ID SENSOR_PATH "temp"

#define REST_CONF_PLATFORM_HAS_SHT_HUMIDITY 1

#define REST_CONF_RES_SHT_HUMIDITY_IF IF_SENSOR
#define REST_CONF_RES_SHT_HUMIDITY_TYPE RELATIVE_HUMIDITY_SENSOR_RT
#define REST_CONF_RES_SHT_HUMIDITY_ID HUMIDITY_SENSOR_RES_ID
#define REST_CONF_RES_SHT_HUMIDITY_FORMAT COAP_RESOURCE_TYPE_DECIMAL_TWO
#define REST_CONF_RES_SHT_HUMIDITY_SO_TYPE HUMIDITY_SENSOR
#define REST_CONF_RES_SHT_HUMIDITY_SO_INSTANCE_ID "0"
#define REST_CONF_RES_SHT_HUMIDITY_IPSO_APP_FW_ID SENSOR_PATH "humidity"

#endif

#if PLATFORM_HAS_BATTERY

#define REST_CONF_PLATFORM_HAS_BATTERY 1

#define REST_CONF_RES_BATTERY_IF IF_SENSOR
#define REST_CONF_RES_BATTERY_TYPE DEVICE_POWER_SUPPLY_VOLTAGE_RT
#define REST_CONF_RES_BATTERY_ID DEVICE_POWER_VOLTAGE_RES_ID

#define REST_CONF_RES_BATTERY_FORMAT COAP_RESOURCE_TYPE_UNSIGNED_INT
#define REST_CONF_RES_BATTERY_IPSO_APP_FW_ID DEVICE_POWER_SUPPLY_ENUM_LINE DEVICE_POWER_SUPPLY_VOLTAGE_RES

#endif

#if PLATFORM_HAS_RADIO

#define REST_CONF_PLATFORM_HAS_RADIO_LQI 1

#define REST_CONF_RES_RADIO_LQI_IF IF_SENSOR
#define REST_CONF_RES_RADIO_LQI_TYPE PERCENT_RT
#define REST_CONF_RES_RADIO_LQI_ID LQI_SENSOR_RES_ID
#define REST_CONF_RES_RADIO_LQI_FORMAT COAP_RESOURCE_TYPE_SIGNED_INT
#define REST_CONF_RES_RADIO_LQI_SO_TYPE GENERIC_SENSOR
#define REST_CONF_RES_RADIO_LQI_SO_INSTANCE_ID "0"
#define REST_CONF_RES_RADIO_LQI_IPSO_APP_FW_ID RADIO_LQI_SENSOR_RES

#define REST_CONF_PLATFORM_HAS_RADIO_RSSI 1

#define REST_CONF_RES_RADIO_RSSI_IF IF_SENSOR
#define REST_CONF_RES_RADIO_RSSI_TYPE DBM_RT
#define REST_CONF_RES_RADIO_RSSI_ID RSSI_SENSOR_RES_ID
#define REST_CONF_RES_RADIO_RSSI_FORMAT COAP_RESOURCE_TYPE_SIGNED_INT
#define REST_CONF_RES_RADIO_RSSI_SO_TYPE GENERIC_SENSOR
#define REST_CONF_RES_RADIO_RSSI_SO_INSTANCE_ID "1"
#define REST_CONF_RES_RADIO_RSSI_IPSO_APP_FW_ID RADIO_RSSI_SENSOR_RES

#endif

#if PLATFORM_HAS_BUTTON

#define REST_CONF_PLATFORM_HAS_BUTTON 1

#define REST_CONF_RES_BUTTON_IF IF_SENSOR
#define REST_CONF_RES_BUTTON_TYPE GPIO_BUTTON_RT
#define REST_CONF_RES_BUTTON_ID STATE_SENSOR_RES_ID
#define REST_CONF_RES_BUTTON_FORMAT COAP_RESOURCE_TYPE_BOOLEAN
#define REST_CONF_RES_BUTTON_SO_TYPE DIGITAL_INPUT
#define REST_CONF_RES_BUTTON_SO_INSTANCE_ID "0"
#define REST_CONF_RES_BUTTON_IPSO_APP_FW_ID GPIO_BUTTON_PATH "0"

#endif

#if PLATFORM_HAS_LEDS

#define REST_CONF_PLATFORM_HAS_LED_RED 1

#define REST_CONF_RES_LED_RED_ACTUATOR 1
#define REST_CONF_RES_LED_RED_IF IF_ACTUATOR
#define REST_CONF_RES_LED_RED_TYPE LIGHT_CONTROL_RT
#define REST_CONF_RES_LED_RED_ID STATE_SENSOR_RES_ID
#define REST_CONF_RES_LED_RED_FORMAT COAP_RESOURCE_TYPE_BOOLEAN
#define REST_CONF_RES_LED_RED_SO_TYPE LIGHT_CONTROL
#define REST_CONF_RES_LED_RED_SO_INSTANCE_ID "0"
#define REST_CONF_RES_LED_RED_IPSO_APP_FW_ID LIGHT_PATH "r" LIGHT_CONTROL_RES

#define REST_CONF_PLATFORM_HAS_LED_GREEN 1

#define REST_CONF_RES_LED_GREEN_ACTUATOR 1
#define REST_CONF_RES_LED_GREEN_IF IF_ACTUATOR
#define REST_CONF_RES_LED_GREEN_TYPE LIGHT_CONTROL_RT
#define REST_CONF_RES_LED_GREEN_ID STATE_SENSOR_RES_ID
#define REST_CONF_RES_LED_GREEN_FORMAT COAP_RESOURCE_TYPE_BOOLEAN
#define REST_CONF_RES_LED_GREEN_SO_TYPE LIGHT_CONTROL
#define REST_CONF_RES_LED_GREEN_SO_INSTANCE_ID "1"
#define REST_CONF_RES_LED_GREEN_IPSO_APP_FW_ID LIGHT_PATH "g" LIGHT_CONTROL_RES

#define REST_CONF_PLATFORM_HAS_LED_BLUE 1

#define REST_CONF_RES_LED_BLUE_ACTUATOR 1
#define REST_CONF_RES_LED_BLUE_IF IF_ACTUATOR
#define REST_CONF_RES_LED_BLUE_TYPE LIGHT_CONTROL_RT
#define REST_CONF_RES_LED_BLUE_ID STATE_SENSOR_RES_ID
#define REST_CONF_RES_LED_BLUE_FORMAT COAP_RESOURCE_TYPE_BOOLEAN
#define REST_CONF_RES_LED_BLUE_SO_TYPE LIGHT_CONTROL
#define REST_CONF_RES_LED_BLUE_SO_INSTANCE_ID "2"
#define REST_CONF_RES_LED_BLUE_IPSO_APP_FW_ID LIGHT_PATH "b" LIGHT_CONTROL_RES

#endif

#endif
